package com.itheima.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CheckGroupCheckItemDao {
    /**
     * 插入数据到 检查组-检查项目表
     * @param checkGroupId
     * @param checkitemId
     */
    @Insert("insert into t_checkgroup_checkitem(checkgroup_id, checkitem_id) VALUES (#{checkGroupId}, #{checkitemId})")
    void add(Integer checkGroupId, Integer checkitemId);

    @Select("select count(*) from t_checkgroup_checkitem where checkgroup_id=#{id}")
    Integer countByCheckGroupId(Integer id);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id=#{checkGroupId}")
    void deleteByCheckGroupId(Integer checkGroupId);

}
